package cn.xgj.sfzy.controller;

import cn.xgj.sfzy.entity.Appointment;
import cn.xgj.sfzy.entity.CourseReply;
import cn.xgj.sfzy.service.AppointmentService;
import cn.xgj.sfzy.service.CourseReplyService;
import cn.xgj.sfzy.util.Result;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName CourseReplyController
 * @Description TODO
 * @Author furuyue
 * @Date 2024年10月28日 17:29
 * @Version 1.0
 */

@RestController
@RequestMapping("/courseReply")
public class CourseReplyController {

    @Autowired
    private CourseReplyService courseReplyService;

    @RequestMapping("/findByUserId")
    public Result findByUserId(Long userId){
        List<CourseReply> list = courseReplyService.findByUSerId(userId);
        return Result.success(list);
    }
    @RequestMapping("/findByCourseTalkId")
    public Result findByCourseTalkId(@Param("courseTalkId") Long courseTalkId){
        List<CourseReply> courseReplyList = courseReplyService.findByCourseTalkId(courseTalkId);
        return Result.success(courseReplyList);
    }
}
